
#ifndef LOCUST_REGISTRY_H__
#define LOCUST_REGISTRY_H__

#include <memory>
#include <string>

#include "converters.h"
#include "registry_error.h"

class registry_storage;

class registry {
public: // Methods

	static void load(const std::string& filename);

	template<typename T>
	static T get(const std::string& key)
	{
		property_converter<T> converter;
		return converter(value_for(key));
	}

private: // Data

	static std::auto_ptr<registry_storage> instance_;

private: // Methods

	static const std::string& value_for(const std::string& key);

};

#endif // LOCUST_REGISTRY_H__
